<?
include 'db_info.php';

// add extra column into existing table
$query_string = "ALTER TABLE  `team` ADD  `isTemp` BOOLEAN NOT NULL";
$query = mysqli_query($connect, $query_string);
$query_string = "ALTER TABLE  `team_time` ADD  `isTemp` BOOLEAN NOT NULL";
$query = mysqli_query($connect, $query_string);

// create timetable for temporary team
$query_string = "CREATE TABLE timetable_temp
(
time VARCHAR(4) NOT NULL,
PRIMARY KEY(time),
monday VARCHAR(20) NOT NULL,
tuesday VARCHAR(20) NOT NULL,
wednesday VARCHAR(20) NOT NULL,
thursday VARCHAR(20) NOT NULL,
friday VARCHAR(20) NOT NULL,
saturday VARCHAR(20) NOT NULL,
sunday VARCHAR(20) NOT NULL
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COMMENT='임시팀 시간표 출력'";
$query = mysqli_query($connect, $query_string);

// initialize timetable
for ($counter = 900; $counter < 2400; $counter += 50) {
	$query_string = "INSERT INTO `timetable_temp` VALUES('$counter', '', '', '', '', '', '', '')";
	$query = mysqli_query($connect, $query_string);
}
?>